#
# 将字符串转化为数字,实现int()方法
s='31001301'
n = 31001301
newstr = s[::-1]
num = 0
for i, e in enumerate(newstr):
    # print(i,e)
    # i是坐标，e是元素
    for j in range(0, 10):
        if e == str(j):
            num = num + j*(10**i)

if num == n:
    print(num)




# s = '298476'
# n = 298476
# s = s[::-1]
# number = 0
# for i, e in enumerate(s):
#     print(i, e)
#     for j in range(0, 10):
#         if e == str(j):
#             number += j*(10**i)

# print(number, type(number))

# for i, e in enumerate(s):
#     if e == s[i]:
#         num = num + int(e)*(10**i)

# num = 0
# for i, v in enumerate(s):
#     num += (ord(v)-ord('0'))*(10**i)

# print(num)